<!DOCTYPE html>
<html>

<head><meta name="generator" content="Hexo 3.8.0">
  
  <title>文章归档：2019/4 - 绪锋</title>
  <meta charset="UTF-8">
  <meta name="description" content="小镇青年,心怀远方">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  

    <!-- Site Verification -->
    <meta name="baidu-site-verification" content="cXpXJOvmtY">

  <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
  <meta name="description" content="小镇青年,心怀远方">
<meta name="keywords" content="个人博客,前端,学习">
<meta property="og:type" content="website">
<meta property="og:title" content="绪锋">
<meta property="og:url" content="https://mraing.github.io/archives/2019/04/page/2/index.html">
<meta property="og:site_name" content="绪锋">
<meta property="og:description" content="小镇青年,心怀远方">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="绪锋">
<meta name="twitter:description" content="小镇青年,心怀远方">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/css/mdui.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.15.8/styles/atom-one-dark.css">
   
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css">
  
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1038733_0xvrvpg9c0r.css">
  <link rel="stylesheet" href="/css/style.css?v=1627371789594">
</head>

<body class="mdui-drawer-body-left">
  
  <div id="nexmoe-background">
    <div class="nexmoe-bg" style="background-image: url(https://i.loli.net/2019/01/13/5c3aec85a4343.jpg)"></div>
    <div class="mdui-appbar mdui-shadow-0">
      <div class="mdui-toolbar">
        <a mdui-drawer="{target: '#drawer', swipe: true}" title="menu" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">menu</i></a>
        <div class="mdui-toolbar-spacer"></div>
        <!--<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">search</i></a>-->
        <a href="/" title="LeeGeing" class="mdui-btn mdui-btn-icon"><img src="/images/avatar.jpg"></a>
       </div>
    </div>
  </div>
  <div id="nexmoe-header">
      <div class="nexmoe-drawer mdui-drawer" id="drawer">
    <div class="nexmoe-avatar mdui-ripple">
        <a href="/" title="LeeGeing">
            <img src="/images/avatar.jpg" alt="LeeGeing">
        </a>
    </div>
    <div class="nexmoe-count">
        <div><span>文章</span>82</div>
        <div><span>标签</span>28</div>
        <div><span>分类</span>8</div>
    </div>
    <ul class="nexmoe-list mdui-list" mdui-collapse="{accordion: true}">
        
        <a class="nexmoe-list-item mdui-list-item mdui-ripple" href="/" title="回到首页">
            <i class="mdui-list-item-icon nexmoefont icon-home"></i>
            <div class="mdui-list-item-content">
                回到首页
            </div>
        </a>
        
        <a class="nexmoe-list-item mdui-list-item mdui-ripple" href="/about.html" title="关于博客">
            <i class="mdui-list-item-icon nexmoefont icon-info-circle"></i>
            <div class="mdui-list-item-content">
                关于博客
            </div>
        </a>
        
        <a class="nexmoe-list-item mdui-list-item mdui-ripple" href="/PY.html" title="我的朋友">
            <i class="mdui-list-item-icon nexmoefont icon-unorderedlist"></i>
            <div class="mdui-list-item-content">
                我的朋友
            </div>
        </a>
        
    </ul>
    <aside id="nexmoe-sidebar">
  
  <div class="nexmoe-widget-wrap">
    <h3 class="nexmoe-widget-title">社交按钮</h3>
    <div class="nexmoe-widget nexmoe-social">
        <a class="mdui-ripple" href="https://space.bilibili.com/11147795" target="_blank" mdui-tooltip="{content: '哔哩哔哩'}" style="color: rgb(231, 106, 141);background-color: rgba(231, 106, 141, .15);">
            <i class="nexmoefont icon-bilibili"></i>
        </a><a class="mdui-ripple" href="https://github.com/mraing/" target="_blank" mdui-tooltip="{content: 'GitHub'}" style="color: rgb(25, 23, 23);background-color: rgba(25, 23, 23, .15);">
            <i class="nexmoefont icon-github"></i>
        </a>
    </div>
</div>
  
  
  <div class="nexmoe-widget-wrap">
    <h3 class="nexmoe-widget-title">文章分类</h3>
    <div class="nexmoe-widget">

      <ul class="category-list">

        


        

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/React/">React</a>
          <span class="category-list-count">7</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/TypeScript/">TypeScript</a>
          <span class="category-list-count">5</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/Vue/">Vue</a>
          <span class="category-list-count">33</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/前端/">前端</a>
          <span class="category-list-count">19</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/博客/">博客</a>
          <span class="category-list-count">3</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/工具/">工具</a>
          <span class="category-list-count">6</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/碎碎念/">碎碎念</a>
          <span class="category-list-count">4</span>
        </li>

        

        <li class="category-list-item">
          <a class="category-list-link" href="/categories/软件设计师/">软件设计师</a>
          <span class="category-list-count">5</span>
        </li>

        
      </ul>

    </div>
  </div>


  
  
  <div class="nexmoe-widget-wrap">
    <h3 class="nexmoe-widget-title">标签云</h3>
    <div id="randomtagcloud" class="nexmoe-widget tagcloud">
      <a href="/tags/Hbuilder/" style="font-size: 10px;">Hbuilder</a> <a href="/tags/Homebrew/" style="font-size: 10px;">Homebrew</a> <a href="/tags/JS/" style="font-size: 14px;">JS</a> <a href="/tags/JSX/" style="font-size: 10px;">JSX</a> <a href="/tags/Mint-UI/" style="font-size: 10px;">Mint-UI</a> <a href="/tags/Nginx/" style="font-size: 10px;">Nginx</a> <a href="/tags/Ngnix/" style="font-size: 10px;">Ngnix</a> <a href="/tags/OpenInTerminal/" style="font-size: 10px;">OpenInTerminal</a> <a href="/tags/Sass/" style="font-size: 14px;">Sass</a> <a href="/tags/Vuex/" style="font-size: 10px;">Vuex</a> <a href="/tags/antd/" style="font-size: 10px;">antd</a> <a href="/tags/css/" style="font-size: 10px;">css</a> <a href="/tags/docsify/" style="font-size: 10px;">docsify</a> <a href="/tags/git/" style="font-size: 12px;">git</a> <a href="/tags/hexo/" style="font-size: 12px;">hexo</a> <a href="/tags/mui/" style="font-size: 18px;">mui</a> <a href="/tags/react/" style="font-size: 14px;">react</a> <a href="/tags/redux/" style="font-size: 10px;">redux</a> <a href="/tags/swiper/" style="font-size: 10px;">swiper</a> <a href="/tags/typescript/" style="font-size: 16px;">typescript</a> <a href="/tags/vue/" style="font-size: 20px;">vue</a> <a href="/tags/vux/" style="font-size: 10px;">vux</a> <a href="/tags/她/" style="font-size: 10px;">她</a> <a href="/tags/感悟/" style="font-size: 12px;">感悟</a> <a href="/tags/日记/" style="font-size: 10px;">日记</a> <a href="/tags/消息推送/" style="font-size: 10px;">消息推送</a> <a href="/tags/知识点/" style="font-size: 10px;">知识点</a> <a href="/tags/软考笔记/" style="font-size: 16px;">软考笔记</a>
    </div>
    
  </div>

  
  
  <div class="nexmoe-widget-wrap">
    <h3 class="nexmoe-widget-title">文章归档</h3>
    <div class="nexmoe-widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/">七月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/03/">三月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/10/">十月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/09/">九月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/07/">七月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">六月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">四月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">一月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">十二月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">九月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">八月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">七月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">六月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">五月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">四月 2019</a></li></ul>
    </div>
  </div>


  
</aside>
    <!-- <div class="nexmoe-copyright">
        &copy; 2021 LeeGeing
        Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
        & <a href="https://nexmoe.com/hexo-theme-nexmoe.html" target="_blank">Nexmoe</a>
    </div> -->
    <div class="nexmoe-copyright">
        <a href="http://beian.miit.gov.cn/state/outPortal/loginPortal.action" target="_blank">湘ICP备16019481号</a>
        <!-- & <a href="https://nexmoe.com/hexo-theme-nexmoe.html" target="_blank">Nexmoe</a> -->
    </div>
</div><!-- .nexmoe-drawer -->
  </div>
  <div id="nexmoe-content">
    <div class="nexmoe-primary">
        <section class="nexmoe-posts" id="brand-waterfall">
    
    <div class="nexmoe-post">
        <a href="/2019/04/17/常用的DOS-命令/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="常用的DOS命令">
                
                <h1>常用的DOS命令</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月17日</a>
            <a><i class="nexmoefont icon-areachart"></i>257 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/工具/">工具</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/Nginx/">Nginx</a>
            
        </div>
        <article>
            
            <blockquote>
<p>DOS命令：计算机术语，是指DOS操作系统的命令，是一种面向磁盘的操作命令，主要包括<code>目录操作类命令</code>、<code>磁盘操作类命令</code>、<code>文件操作类命令</code>和<code>其它命令</code>。</p>
</blockquote>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/17/JS简便替换空值/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="JS 简便替换空值">
                
                <h1>JS 简便替换空值</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月17日</a>
            <a><i class="nexmoefont icon-areachart"></i>101 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/前端/">前端</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/JS/">JS</a>
            
        </div>
        <article>
            
            <p>在与后台对接的时候，经常有时候会拿到一个空值 <code>undefined</code>，把 <code>undefined</code> 显示在页面上，对于普通用户来说，是不可行的。以下有一中简便的方便，快速替换 <code>undefined</code>。</p>
<p>这行代码的意思就是：如果值为<code>false</code>，那么就采用后面的，如果值为<code>true</code>，那么就采用前面的。</p>
<pre><code>var myEntryStandard = ParentDelivery[i].EntryStandard||&quot;无&quot;;
</code></pre>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/16/Hexo添加全局搜索/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt=" Hexo添加全局搜索">
                
                <h1> Hexo添加全局搜索</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月16日</a>
            <a><i class="nexmoefont icon-areachart"></i>91 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/博客/">博客</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/hexo/">hexo</a>
            
        </div>
        <article>
            
            <h4 id="安装搜索插件hexo-generator-searchdb"><a href="#安装搜索插件hexo-generator-searchdb" class="headerlink" title="安装搜索插件hexo-generator-searchdb"></a>安装搜索插件<code>hexo-generator-searchdb</code></h4><pre><code>npm install hexo-generator-searchdb --save
</code></pre><h4 id="找到到博客配置文件-config-yml，添加如下配置"><a href="#找到到博客配置文件-config-yml，添加如下配置" class="headerlink" title="找到到博客配置文件 _config.yml，添加如下配置"></a>找到到博客配置文件 <code>_config.yml</code>，添加如下配置</h4><pre><code>search:
  path: search.xml
  field: post
  format: html
  limit: 10000
</code></pre><h4 id="Next-主题自带搜索设置，编辑主题配置文件：-config-yml"><a href="#Next-主题自带搜索设置，编辑主题配置文件：-config-yml" class="headerlink" title="Next 主题自带搜索设置，编辑主题配置文件：_config.yml"></a>Next 主题自带搜索设置，编辑主题配置文件：<code>_config.yml</code></h4><p>找到文件中 Local search 的相关配置，设为 true</p>
<pre><code># Local search
local_search:
  enable: true
</code></pre><h4 id="重新部署-hexo"><a href="#重新部署-hexo" class="headerlink" title="重新部署 hexo"></a>重新部署 hexo</h4><pre><code>$ hexo clean
$ hexo g
$ hexo d
</code></pre>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/16/JS格式化时间戳/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="JS格式化时间戳">
                
                <h1>JS格式化时间戳</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月16日</a>
            <a><i class="nexmoefont icon-areachart"></i>169 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/前端/">前端</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/JS/">JS</a>
            
        </div>
        <article>
            
            <blockquote>
<p>在项目中经常会遇到后台接口返回来的时间戳，我们需要转换一下才能显示日常使用的时间格式。</p>
</blockquote>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/15/MUI子页面向父页面传参/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="MUI子页面向父页面传参">
                
                <h1>MUI子页面向父页面传参</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月15日</a>
            <a><i class="nexmoefont icon-areachart"></i>281 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/前端/">前端</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/mui/">mui</a>
            
        </div>
        <article>
            
            <p>经常有这样的需求：子页面新增数据后完成后，跳转到父页面的列表界面。但是 MUI 采用的是页面跳转其实是打开新窗口，返回父页面并不会刷新父页面，只是把子页面关闭，父页面从始至终都在那里并没有刷新过。</p>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/14/MUI父页面向子页面传参/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="MUI父页面向子页面传参">
                
                <h1>MUI父页面向子页面传参</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月14日</a>
            <a><i class="nexmoefont icon-areachart"></i>220 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/前端/">前端</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/mui/">mui</a>
            
        </div>
        <article>
            
            <blockquote>
<p>在以往有讲过MUI 创建新页面 ，其中有提到 <code>extras</code> 传参。</p>
</blockquote>
            
        </article>
    </div>
    
    <div class="nexmoe-post">
        <a href="/2019/04/13/MUI创建新页面/">
            <div class="nexmoe-post-cover mdui-ripple"> 
                
                    <img src="https://i.loli.net/2019/01/13/5c3aec85a4343.jpg" alt="MUI创建新页面">
                
                <h1>MUI创建新页面</h1>
            </div>
        </a>
        <div class="nexmoe-post-meta">
            <a><i class="nexmoefont icon-calendar-fill"></i>2019年04月13日</a>
            <a><i class="nexmoefont icon-areachart"></i>353 字</a>
            <a><i class="nexmoefont icon-time-circle-fill"></i>大概 1 分钟</a>
            
                <a class="nexmoefont icon-appstore-fill -link" href="/categories/前端/">前端</a>
            
            
                <a class="nexmoefont icon-tag-fill -link" href="/tags/mui/">mui</a>
            
        </div>
        <article>
            
            <p>在常规的前端开发中,我们经常使用<code>a</code>标签中的<code>href</code>属性来进行页面之间的跳转和传参.</p>
<p>但是这样会产生一个问题,<code>a</code>标签打开的页面返回时并不是返回到上一个页面,返回只是一个后退的操作.</p>
<p>如果对页面进行多次操作页面,当你想回到上一个页面时,就会来回的切换页面,严重影响体验.</p>
<p>在一个项目中,我们可以写一个公共的<code>JS</code>文件,创建新页面方法,代码如下.</p>
<pre><code>//创建新页面
function openUrl(url, id, params) {
    if (typeof(params) == &#39;undefined&#39;) {
        params = {};
    }
    if (mui.os.plus) {
        mui.openWindow({
            id: id,          //url:新页面的地址
            url: url,        //id:新页面的 WebView ID
            extras: params,  //params:页面传参
            styles: {
                statusbar: {
                    //设置新页面状态栏背景颜色，以便达到沉浸式状态栏
                    background: &#39;#3EAD74&#39;,
                    color: &#39;#FFFFFF&#39;
                }
            }
        })
    } else {
        window.location.href = url;
    }
}
</code></pre><p>引用 <code>js</code> 文件后就可以,我们可以用<code>a</code>标签进行快速的使用.</p>
<pre><code>&lt;a href=&quot;javascript:openUrl(&#39;url&#39;,&#39;id&#39;,{})&quot;&gt;打开新的 webview页面&lt;/a&gt;
</code></pre><p>我们可以很方便的用 a 标签进行传参，但是要注意的是，在动态生成的 DOM 结构里，用 a 标签来传参的话，页面跳转会失效。我的建议是用JS点击绑定事件进行页面的跳转和传参。</p>

            
        </article>
    </div>
    
</section>

    <nav class="nexmoe-page-nav">
      <a class="extend prev" rel="prev" href="/archives/2019/04/"><i class="nexmoefont icon-left"></i></a><a class="page-number" href="/archives/2019/04/">1</a><span class="page-number current">2</span>
    </nav>
  
    </div>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/js/mdui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
 
    <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>


 
    <script src="https://cdn.jsdelivr.net/npm/smoothscroll-for-websites@1.4.9/SmoothScroll.min.js"></script>


<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.8/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

<script src="/js/app.js?v=1627371789600"></script>
<script src="https://cdn.jsdelivr.net/npm/lazysizes@5.1.0/lazysizes.min.js"></script>


    <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/xtaodada/xtaodada.github.io@0.0.2/copy.js"></script>

  





</body>

</html>
